﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="VehicleIndex.aspx.cs" Inherits="VehicleUI_VehicleIndex" Theme="Red" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
  <title>jQuery UI Tabs - Default functionality</title>
  <link href="../CSS/jquery-ui.css" rel="stylesheet" type="text/css" />
  <script src="../JavaScript/jquery-1.9.1.js" type="text/javascript"></script>
  <script src="../JavaScript/jquery-ui.js" type="text/javascript"></script>
  <script type="text/javascript">
      $(document).ready(function() {

          //车牌号自动下拉
          $("#txt_VehicleID").autocomplete({ source: "../ashx/autocomplete.ashx" });

          //判断是否存在该车
          $("#txt_VehicleID").blur(function() {

              $.get("../ashx/validate.ashx", { ID: $("#txt_VehicleID").val() }, function(data, status) {
                  if (data == "") {
                      alert("不存在该车信息,请重新录入车牌号或车架号!");
                      //alert("数据：" + data + "\n状态：" + status);
                  }
                  else {
                      $("#txt_FrameNO").val(data);
                  }
              });

          });



          $("#btn_Sure").click(function() {
              var frameNO = $("#txt_FrameNO").val();
              //alert("测试成功" + frameNO);
              $("#tab1").attr("href", "Base/VehicleAMV.aspx?Type=View&FrameNO=" + frameNO);
              $("#tab1").trigger("click");
              $("#tab2").attr("href", "CheckScore/CheckScoreMgr.aspx?FrameNO=" + frameNO);
              $("#tab2").trigger("click");
              $("#tab3").attr("href", "Violation/ViolationMgr.aspx?FrameNO=" + frameNO);
              $("#tab3").trigger("click");
              $("#tab4").attr("href", "Repair/RepairMgr.aspx?FrameNO=" + frameNO);
              $("#tab4").trigger("click");
          });

      });


      $(function() {
          $("#tabs").tabs({
              beforeLoad: function(event, ui) {
                  ui.jqXHR.error(function() {
                      ui.panel.html(
                "Couldn't load this tab. We'll try to fix this as soon as possible. " +
                "If this wouldn't be a demo.");
                  });
              }
          });
      });



      
  </script>
</head>

<body>

    <form id="form1" runat="server">
       <div style=" width:95%; height:30px; float:left; text-align:center;">
                    <asp:Label ID="Label19" runat="server" Text="车牌号" Font-Bold="True"></asp:Label>
                    <asp:TextBox ID="txt_VehicleID" runat="server" Width="107px" ></asp:TextBox>
                &nbsp;&nbsp;
                    <asp:Label ID="Label1" runat="server" Text="车架号" Font-Bold="True"></asp:Label>
                    <asp:TextBox ID="txt_FrameNO" runat="server" Width="107px" ></asp:TextBox>
                    &nbsp;
           <%--    <asp:Button ID="btn_Sure" runat="server" Text="确定" onclick="btn_Sure_Click" />--%>   
         <input id="btn_Sure" type="button" value="确定" />
     </div>

<div id="tabs" style=" float:left; width:98%; ">
  <ul>
    <li><a id="tab1" href="#tabs-1">基本信息</a></li>
    <li><a id="tab2" href="#tabs-1">检查评分</a></li>
    <li><a id="tab3" href="#tabs-1">违章</a></li>
    <li><a id="tab4" href="Repair/RepairMgr.aspx">维修</a></li>
  </ul>
  <div id="tabs-1">
    <p>请先选择车辆！</p>
  </div>
</div>

    </form>

</body>
</html>
